<?php

namespace App\Http\Requests\Home;

use Illuminate\Foundation\Http\FormRequest;

class PassRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'npass' => 'required|min:8|max:16'
        ];
    }

    public function messages()
    {
        return [
           'npass.required' => '密码不能为空',
           'npass.min' => '密码不能少于8位',
           'npass.max' => '密码不能多于16位' 
        ];
    }
}
